<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>React03</title>
  <!-- 核心库 -->
  <script src="./js/react.development.js"></script>
  <!-- 操作DOM库 -->
  <script src="./js/react-dom.development.js"></script>
  <!-- jsx转js -->
  <script src="./js/babel.min.js"></script>
</head>

<body>
  <div id="app"></div>

  <script type="text/babel">
    // 1.创建虚拟DOM
    // const VDOM = <h1 id="title">Hello,React</h1> // 此处一定不写引号 jsx语法
    const VDOM = (
      <h1>
        <span>Hello,React</span>
      </h1>
    )
    // 2.渲染DOM到页面 (vdom, 容器)
    ReactDOM.render(VDOM, document.getElementById('app'))
    // VDOM就是一个一般对象 Object
    console.log('虚拟DOM', VDOM)
    console.dir(document.getElementById('app'))
  </script>
</body>

</html>